<?php
	require_once dirname(BASEPATH) . '/application/models/local/data/_init_model.php';
	
	class mod_permission extends _init_model
	{
		public $PMS_ID;
		public $PMS_VAL;
		public $PMS_DESC;
		
		function __construct(){
			parent::__construct();
		
			$this->tableName = "PERMISSION";
		}
		
		function get_permission_desc($permission_id){
			$sqlcmd = 'SELECT PMS_DESC FROM ' . $this->tableName;
			$sqlcmd .= ' WHERE PMS_ID = ' . $permission_id;
			$query = $this->db->query($sqlcmd);
			
			if ($query->num_rows() > 0)
				return $query->row(0)->PMS_DESC;
			else
				return null;
		}
		function get_permission_value($permission_id){
			$sqlcmd = 'SELECT PMS_VAL FROM ' . $this->tableName;
			$sqlcmd .= ' WHERE PMS_ID = ' . $permission_id;
			$query = $this->db->query($sqlcmd);
			
			if ($query->num_rows() > 0)
				return $query->row(0)->PMS_VAL;
			else
				return null;			
		}
	}
?>